import Vue from 'vue'
import Router from 'vue-router'
import PosList from '@/components/PosList'
import UserInfo from '@/components/UserInfo'
import Article from '@/components/Article'
import SideBar from '@/components/SideBar'

Vue.use(Router)

export default new Router({
  mode: 'history',//去掉url的#号
  routes: [
    {
      path: '/',
      name: 'root',
      components: {
        main:PosList
      }
    },
    {
      path:'/user/:name',
      name:"user_info",
      components:{
        main:UserInfo
      }
    },
    {
      path:'/topic/:id&auther=:name',
    	name:'post_content',
    	components:{
    		main:Article,
    		sidebar:SideBar
    	}
    }
  ]
})
